import Request from '@/common/request/index.js'
let url = "https://fwaq.jst.zj.gov.cn/wtjdgl/"
let url2 = "https://nfzjszlb.jst.zj.gov.cn/tyzcpt/"
let url1 = "https://nfzjszlb.jst.zj.gov.cn/tyzcpt/"
let urlzf="https://fwaq.jst.zj.gov.cn/jsmart/"
export function getDatalistForTree(data) {
    return Request.get(url + `api/rescatalog/gsaCodeCity/listForTree/` + data)
}

export function Login(pass, checkPass) {
    return Request.get(url + 'api/user/login', {
        username: pass,
        password: checkPass
    })
}
export function getUserInfoGSa(data) {
    return Request.get(url + `api/user/userManagerForHangZhou/getUserInfo/` + data)
}

//ECA接口封装
/**
 * 
 * @param {*} data 
 * @returns
 *77fdf2b0-0eb5-4243-a0a4-6185299ccd34 市 e9c98787-4966-4365-80b0-c1cc678c6f85；区县：77fdf2b0-0eb5-4243-a0a4-6185299ccd34；镇：24d07248-ba49-4b82-9029-b5eccaff179d；村： 
 *30c64dd9-9db2-4d30-ad8f-62d219de2325 事件委托 bcc29049-e7a8-450c-b40e-e4cd2e600cb9 建筑层数 5606ea58-5e29-470d-8d99-2a936585ad99建造年份
 *  请求参数
formdata
```
dataGuid: 77fdf2b0-0eb5-4243-a0a4-6185299ccd34
searchObject: [{"field":"CITYCODE","value":"330102000000"}]
time: 1661425054336
token: 用户token
viewParameter: {}
```
 */
export function ECAOpenDataView(data,data1,data2) {
    return Request.get(url + 'dataServer/api/OpenDataView?dataGuid='+data+'&searchObject='+encodeURIComponent(data1)+'&time='+data2+'&token='+uni.getStorageSync('token')+'&viewParameter=%7B%7D')
}

/**
 * 
 * @param {*} data 
 * @returns 
 * * 请求参数
formdata
```
dataGuid: 55bda5cf-5037-42a7-987e-585d35cd5418
strParams: [{"PKID":3,"SQR":"LIAOLONG","SQRLX":1,"CREATER_USER_PKID":1,...}]
time: 1661346364593
token: 用户token
viewParameter: {}
**使用方式**
```
个人申请推送到业务系统时：SQRLX传1，SQRHSYR为必填，SQLX为必填，IF_KNJT为必填，WTDW不填。
企业申请推送到业务系统时：SQRLX传2，SQRHSYR不填，SQLX不填，IF_KNJT不填，WTDW为必填。
 */
export function ECAinsertDataView(data) {
    return Request.post(url + 'dataServer/api/insertDataView', data)
}

/**
 * 
 * @param {*} data 
 * @returns 
 * * 请求参数 1
formdata
```
file: 文件
toRowGuid: 数据行row_guid
groupGuid: 02de3608-565e-4e9a-959f-2c1b4e623065 或 f46db8bc-ac1c-4f5d-ab0e-45166a94b6f1
token: 用户token
viewParameter: {}
```
其他相关文件：02de3608-565e-4e9a-959f-2c1b4e623065 其他照片：f46db8bc-ac1c-4f5d-ab0e-45166a94b6f1
身份证正面照片：19902700-f952-4561-a338-5590056dab65 身份证反面照片：d26fd8fd-0d8a-46ec-af9f-2341ba78fb58
8ae061e7-ad06-48ec-bae4-5ba0732a4d77  合同
 */
export function ECAFileServerUpload(data) {
    return Request.postJSON(url + 'FileServer/api/Upload', data)
}

/**
 * formdata
```
procName: up_ht_by_pkid
dtParams: [{"i_type":0,"i_ht_type":5,"i_pkid":6}]
time: 1661482356551
token: 业务系统用户token
viewParameter: {}
```
 */

export function ECAExecProcedure(data) {
    return Request.post(url + 'DataServer/api/ExecProcedure', data)
}

/**
formdata
```
dataguid: 2557f4c7-9f3c-4333-a26b-76a228909ce4
searchObject: []
bizGuid: 82c1d3c7-f56a-4414-8382-f06e13a9772e
time: 1661476101030
token: 用户token
viewParameter: {}
```
 */

export function ECALoadGridData(data) {
    return Request.post(url + 'dataserver/api/LoadGridData', data)
}

/**
 * 发送
 * formdata
```
taskId: 143947
direction: 1
wfBoxGuid: 82c1d3c7-f56a-4414-8382-f06e13a9772e
actionText: 
taskName: 
wfGuid: {48A968B4-A044-4115-A9DB-099029B2E011}
sendNodes: [{"TNID":2,"PTNID":1,"TEXT":"系统管理员","WFNODEGUID":"{706FEA46-A95A-41DE-A798-03933076A993}","WFNODETYPE":1,"WFNODENAME":"个人委托","ISUSER":1,"USERID":1,"USERNAME":"系统管理员","SINGLEASSIGN":true,"SORTNUM":0,"selected":true}]
time: 1661506955342
token: 用户token
viewParameter: {}
```
 */

export function ECAPlatSendTask(data) {
    return Request.post(url + 'WorkFlowServer/api/PlatSendTask', data)
}

/**
 * 创建流程
 * formdata
```
wfGuid: {48A968B4-A044-4115-A9DB-099029B2E011}
entityRowGuid: f2546064-406a-4a6a-93a7-9380309e0517
time: 1661602306329
token: eyJhbGciOiJIUzI1NiJ9.eyJzaWduSW5UaW1lIjoiMTY2MTYwMDc1MjY4OCIsImlzcyI6IkVDQSIsInNlc3Npb25JZCI6Ik1XTTVOREEyTnpNeExUVXdZbU10TkdVeU15MWlNMlkxTFdJM1pUZGtNekE1TXpnM05RPT0xNjYxNjAwNzUyNjg4IiwiZXhwIjoxNjYyMjA1NTUyLCJpYXQiOjE2NjE2MDA3NTIsImp0aSI6IjJhNDNhYjJlLThjZTktNGVkNS04MWU2LTI0ZTI2YzM5ZTdmNSJ9.Z3Y_tcAlFDj_eKq-w16cimn5PZ6tB3RaVi5CGRoCks8
viewParameter: {}
```
 */

export function ECAPrepareCreateProcess(data) {
    return Request.post(url + 'WorkFlowServer/api/PrepareCreateProcess', data)
}
/**
 * http://10.142.4.109:9501/WorkFlowServer/api/LoadWorkflowScript?
 * taskId=-1&wfGuid=%7B48A968B4-A044-4115-A9DB-099029B2E011%7D&time=1661602310976&token=eyJhbGciOiJIUzI1NiJ9.eyJzaWduSW5UaW1lIjoiMTY2MTYwMDc1MjY4OCIsImlzcyI6IkVDQSIsInNlc3Npb25JZCI6Ik1XTTVOREEyTnpNeExUVXdZbU10TkdVeU15MWlNMlkxTFdJM1pUZGtNekE1TXpnM05RPT0xNjYxNjAwNzUyNjg4IiwiZXhwIjoxNjYyMjA1NTUyLCJpYXQiOjE2NjE2MDA3NTIsImp0aSI6IjJhNDNhYjJlLThjZTktNGVkNS04MWU2LTI0ZTI2YzM5ZTdmNSJ9.Z3Y_tcAlFDj_eKq-w16cimn5PZ6tB3RaVi5CGRoCks8&viewParameter=%7B%7D
 */

/**
 * ECA的登录接口
 */

 export function ECAPrepareLoadWorkflowScript(data,data1,wfguid) {
    return Request.get(url + `WorkFlowServer/api/LoadWorkflowScript?taskId=${data}&wfGuid=${encodeURIComponent(wfguid)}&time=${data1}`)
}

/**
 * 
 * http://10.142.4.109:9501/WorkFlowServer/api/CreateProcess
 */

 export function ECAPrepareLoadCreateProcess(data) {
    return Request.post(url + `WorkFlowServer/api/CreateProcess`,data)
}

/**
 * 
 * http://10.142.4.109:9501/FileServer/api/GetFilesInfo?groupGuid=8ae061e7-ad06-48ec-bae4-5ba0732a4d77&toRowGuid=45a39dd2-4dbc-4a9a-ba2b-24e295e7f2b6&time=1661607490682&token=eyJhbGciOiJIUzI1NiJ9.eyJzaWduSW5UaW1lIjoiMTY2MTYwNjg0Mzk1NCIsImlzcyI6IkVDQSIsInNlc3Npb25JZCI6Ik1XTTVOREEyTnpNeExUVXdZbU10TkdVeU15MWlNMlkxTFdJM1pUZGtNekE1TXpnM05RPT0xNjYxNjA2ODQzOTU0IiwiZXhwIjoxNjYyMjExNjQzLCJpYXQiOjE2NjE2MDY4NDMsImp0aSI6IjI2ZGViMzk4LTU3NmMtNDE2NS04MTYzLWZlZjgzYTdlNDQwNiJ9.YojR3abEpgKshGHSO0WO70VXqOhWGhfVKKoyzpwx2So&viewParameter=%7B%7D
 */

 export function ECAPrepareGetFilesInfo(data,time) {
    return Request.get(url + `/FileServer/api/GetFilesInfo?groupGuid=8ae061e7-ad06-48ec-bae4-5ba0732a4d77&toRowGuid=${data}&time=${time}`)
}


/**
 * 
 * http://10.142.4.109:9501/WorkFlowServer/api/LoadSendFormData?taskId=143966&direction=0&time=1661607764065&token=eyJhbGciOiJIUzI1NiJ9.eyJzaWduSW5UaW1lIjoiMTY2MTYwNjg0Mzk1NCIsImlzcyI6IkVDQSIsInNlc3Npb25JZCI6Ik1XTTVOREEyTnpNeExUVXdZbU10TkdVeU15MWlNMlkxTFdJM1pUZGtNekE1TXpnM05RPT0xNjYxNjA2ODQzOTU0IiwiZXhwIjoxNjYyMjExNjQzLCJpYXQiOjE2NjE2MDY4NDMsImp0aSI6IjI2ZGViMzk4LTU3NmMtNDE2NS04MTYzLWZlZjgzYTdlNDQwNiJ9.YojR3abEpgKshGHSO0WO70VXqOhWGhfVKKoyzpwx2So&viewParameter=%7B%7D
 */

 export function ECAPLoadSendFormData(data,time) {
    return Request.get(url + `WorkFlowServer/api/LoadSendFormData?taskId=${data}&direction=0&time=${time}`)
}




/**
 * 
 * http://10.142.4.109:9501/WorkFlowServer/api/LoadWorkflowScript?taskId=143951&time=1661602376409&token=eyJhbGciOiJIUzI1NiJ9.eyJzaWduSW5UaW1lIjoiMTY2MTYwMDc1MjY4OCIsImlzcyI6IkVDQSIsInNlc3Npb25JZCI6Ik1XTTVOREEyTnpNeExUVXdZbU10TkdVeU15MWlNMlkxTFdJM1pUZGtNekE1TXpnM05RPT0xNjYxNjAwNzUyNjg4IiwiZXhwIjoxNjYyMjA1NTUyLCJpYXQiOjE2NjE2MDA3NTIsImp0aSI6IjJhNDNhYjJlLThjZTktNGVkNS04MWU2LTI0ZTI2YzM5ZTdmNSJ9.Z3Y_tcAlFDj_eKq-w16cimn5PZ6tB3RaVi5CGRoCks8&viewParameter=%7B%7D
 */


export function ECALogin(pass, checkPass, sign, time) {
    return Request.post(url + 'authserver/Auth/LoginCheck', {
        name: pass,
        pwdmd5: checkPass,
        sign: sign,
        time: time,
        vcode: "idl+=adfi@asdi"
    })
}

export function ECAfarmerHouseGetToken (data) {
    return Request.post(url + 'authserver/Auth/GetAccessToken', {
        code: data
    })
}


/**
 * 鉴定机构
 */

 export function findCompanyInformation (data) {
    return Request.postJSON(url1 + 'forwarding/appraise/findCompanyInformation',
    data)
}


/**
 * 微信小程序单点登录
 */

 export function getwxAppletUser (data) {
    return Request.get(url + '/dataexchangeserver/zlbsso/wxAppletUser/v1?ticket='+data)
}

/**
 * app个人单点登录
 */

 export function getAppletUser (data) {
    return Request.get(url + '/dataexchangeserver/zlbsso/user/v1?ticket='+data)
}


/**
 * app法人单点登录
 */

 export function getFRSSOToken (data,data1) {
    return Request.post(url + '/dataexchangeserver/zlbsso/getFRSSOToken?ssotoken='+data+'&ssoticket='+data1)
}



//注册接口
export function getRegister (data) {
    return Request.postJSON(url + '/dataexchangeserver/hzRegister/saveRel', data)
}


//房屋
export function existHouseBaseInfo (data,data1) {
    return Request.get(url2 + `/api/farmerHouse/share/existHouseBaseInfo/v2?idCard=${data}&householderName=${data1}`)
}

//文件预览
export function FileServer (data) {
    return Request.get(url + `FileServer/api/Preview?fileGuid=${data}&token=${uni.getStorageSync('token')}`)
}


//企业列表接口
export function getServiceData (data) {
    return Request.postJSON(url + `dataexchangeserver/proxy/service/v2`,data)
}


//签合同接口
export function HXSignForPlatForm(data) {
    return Request.postJSON(url1 + `api/farmerHouse/govSign/HXSignForPlatForm`,data)
}
/**
 * 中房提供城镇房屋接口
 */
//根据房屋坐落或者项目名称，搜索符合条件的房屋信息列表
export function getJdFwxxToJs(data) {
    return Request.postJSON(url1 + `api/farmerHouse/proxy/getJdFwxxToJs`,data)
}